import Vue from 'vue'
import Router from 'vue-router'
// import home from '@/view/home'
// import music from '@/view/music'
// import movie from '@/view/movie'

Vue.use(Router)

const routes = () => {
  return [
    { path: '/',
      redirect: '/home'
    },
    { path: '/home',
      name: 'home',
      component: resolve => require(['@view/home'], resolve),
      children: [
        {
          path: '/home/zi',
          name: 'zi',
          component: resolve => require(['@view/zi'], resolve)
        }
      ]
    },
    { path: '/music',
      name: 'music',
      component: resolve => require(['@view/music'], resolve)
    },
    {
      path: '/movie',
      name: 'movie',
      component: resolve => require(['@view/movie'], resolve)
    },
    {
      path: '/home/zi',
      name: 'zi',
      component: resolve => require(['@view/zi'], resolve)
    }
  ]
}
const router = new Router({
  routes: routes()
})
// 将路由配置公布
export default router
/* export default new Router({
  routes: [
    {
      path: '/',
      name: 'home',
      component: home
    },
    {
      path: '/home',
      name: 'home',
      component: home
    },
    {
      path: '/music',
      name: 'music',
      component: music
    },
    {
      path: '/movie',
      name: 'movie',
      component: movie
    }
  ]
}) */
